package drds.server.handler;

import java.util.List;

import drds.server.datasource.IConnectionHolder;

/**
 * 
 */
public class DelegateResponseHandler extends HandlerAdapter {
	private final Handler handler;

	public DelegateResponseHandler(Handler handler) {
		if (handler == null) {
			throw new NullPointerException("handler");
		}
		this.handler = handler;
	}

	@Override
	public void connectionAcquired(IConnectionHolder connectionHolder) {
		handler.connectionAcquired(connectionHolder);
	}

	@Override
	public void connectionError(IConnectionHolder connectionHolder, Throwable e) {
		handler.connectionError(connectionHolder, e);
	}

	@Override
	public void okResponse(IConnectionHolder connectionHolder, byte[] okBytes) {
		handler.okResponse(connectionHolder, okBytes);
	}

	@Override
	public void errorResponse(IConnectionHolder connectionHolder, byte[] errorBytes) {
		handler.errorResponse(connectionHolder, errorBytes);
	}

	@Override
	public void fieldEofResponse(IConnectionHolder connectionHolder, byte[] headerBytes, List<byte[]> fieldBytesList, byte[] eofBytes) {
		handler.fieldEofResponse(connectionHolder, headerBytes, fieldBytesList, eofBytes);
	}

	@Override
	public void rowResponse(IConnectionHolder connectionHolder, byte[] rowBytes) {
		handler.rowResponse(connectionHolder, rowBytes);
	}

	@Override
	public void rowEofResponse(IConnectionHolder connectionHolder, byte[] eofBytes) {
		handler.rowEofResponse(connectionHolder, eofBytes);
	}

	@Override
	public void writeQueueAvailable() {
		handler.writeQueueAvailable();

	}

	@Override
	public void connectionClose(IConnectionHolder connectionHolder, String reason) {
		handler.connectionClose(connectionHolder, reason);
	}

}